
import React from 'react'
// 导入路由
import {BrowserRouter as Router, Route, Redirect} from 'react-router-dom'

// 导入Home和cityList组件(页面组件)
import Home from './pages/Home'
import CityList from './pages/CityList'
import Map from './pages/Map'

export default function App () {
  return (
    <Router>
      <div className='App'>
        {/* 默认路由 */}
        <Route path="/" exact render={()=> <Redirect to="/home"/>}></Route>
      {/* 配置路由 */}
      <Route path="/home" component={Home}></Route>
      <Route path="/citylist" component={CityList}></Route>
      <Route path="/map" component={Map}></Route>
      </div>
    </Router>
  )
}